import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    // {
    //   path: '/',
    //   name: 'index.vue',
    //   component: Home
    // },
    {
      path:'/index1',
      name:'/Index1',
      component: () => import( './views/Index1.vue'),

      children:[
        {
          path: '/home1',
          name: 'home1',

          component: () => import( './views/sys/home1.vue'),
        },
        {
          path: '/allGames1',
          name: 'allGames1',

          component: () => import( './views/sys/allgames1.vue')
        },
        {
          path: '/cart',
          name: 'cart',

          component: () => import( './views/sys/cart.vue')
        },{
          path: '/owns',
          name: 'owns',

          component: () => import( './views/sys/owns.vue')
        },
        {
          path: '/myOrder',
          name: 'myOrder',

          component: () => import( './views/sys/myOrder.vue')
        },
      ]
    },
    {
      path: '/',
      name: 'Index',

      component: () => import( './views/Index.vue'),
      children:[
        {
          path: '/home',
          name: 'home',

          component: () => import( './views/sys/home.vue'),
        },
        {
          path: '/allGames',
          name: 'allGames',

          component: () => import( './views/sys/allgames.vue')
        },

      ]
    },
    {
      path: '/admin',
      name: 'admin',

      component: () => import( './views/admin.vue'),
      children:[

        {
          path: '/userManage',
          name: 'userManage',

          component: () => import( './views/sys/userManage.vue')
        },
        {
          path: '/orderManage',
          name: 'orderManage',

          component: () => import( './views/sys/orderManage.vue')
        }, {
          path: '/goodsManage',
          name: 'goodsManage',

          component: () => import( './views/sys/goodsManage.vue')
        }
      ]
    },
    {
      path: '/Login',
      name: 'Login',

      component: () => import( './views/Login.vue')
    },
    {
      path: '/register',
      name: 'register',

      component: () => import( './views/register.vue')
    }
  ]
})
